package com.jd.learn;

import com.jd.learn.event.spring.ApplicationEventTest;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * @author shenkaiwen5
 * @version 1.0
 * @date 2020/12/22
 */
@SpringBootApplication
@EnableAsync
public class DemoApplication {

    public static void main(String[] args) {
        //SpringApplication.run(DemoApplication.class, args);
        SpringApplication application = new SpringApplication(DemoApplication.class);

        ConfigurableApplicationContext context = application.run(args);
        //发布事件
        context.publishEvent(new ApplicationEventTest(new Object()));
    }

}
